package com.opentae.data.mall.interfaces;

import com.opentae.core.mybatis.config.MyBatisRepository;
import com.opentae.core.mybatis.mapper.Mapper;
import com.opentae.data.mall.pojo.BonusTrade;
import com.opentae.data.mall.beans.MallTrade;
import com.opentae.data.mall.pojo.TradeReportData;
import org.apache.ibatis.annotations.Param;
import org.springframework.context.annotation.Lazy;
import org.springframework.context.annotation.Scope;

import java.util.Date;
import java.util.List;

/**
 * 
 * Created by exampleCreater.
 */
@MyBatisRepository("tae_mall_mallTradeMapper")
@Scope("singleton")
@Lazy(true)
public interface MallTradeMapper extends Mapper<MallTrade> {
    Long selTidByTradeCode(@Param("tradeCode")String tradeCode);

    /**
     *
     * @description 根据tradeCode获取trade
     * @author 郭尔
     * @date 2019/1/15 15:14
     */
    MallTrade selByTradeCode(@Param("tradeCode")String tradeCode);

    /**
     * @description 用户佣金预计收益
     * @author 郭尔
     * @date 2019-04-30 17:15
     */
    String userCommission(@Param("rewardId") Long rewardId);

    Long getBuyer(@Param("tradeCode")String tradeCode);

    /**
     *
     * @description 查询要分配奖励的订单
     * @author 郭尔
     * @date 2019-11-11 15:10
     */
    List<BonusTrade> selBonusTrade();

    /**
     *
     * @description
     * @author 郭尔
     * @date 2019-11-21 15:23
     */
    TradeReportData selTradeReportData(@Param("start") Date start, @Param("end")Date end,@Param("payWay")Integer payWay);

}
